<template>
    <div class="fenlei">
        <template v-if="isLoginCrm === true">
            <h2>注销</h2>
            <ul>
                <li>{{loginName}}</li>
                <li>
                    <el-button size="mini" @click="logout()">注销</el-button>
                </li>
            </ul>
        </template>
        <template v-else>
            <h2>登陆</h2>
            <ul>
                <li>用户：<input v-model="username" type="text"/></li>
                <li>密码：<input v-model="password" type="password"/></li>
                <li>
                    <el-button size="mini" @click="login()">登陆</el-button>
                </li>
            </ul>
        </template>
    </div>
</template>

<script>
    export default {
        name: "login",
        data() {
            return {
                b_user: {
                    username: "",
                    password: ""
                },
                isLoginCrm: this.$store.state.userIslogin,
                loginName: this.$store.state.userName
            }
        },
        methods: {
            login: function () {
                alert(this.b_user);
            },
            logout: function () {
                alert("注销")
            }
        },
        mounted() {

        }
    }
</script>
